<html>
<head><title>My Test Extension Options</title></head>
<script type="text/javascript" src="jquery-1.3.2.min.js"/>
<script type="text/javascript">

// Saves options to localStorage.
function save_options() {
  
  var status = document.getElementById("status");
  status.innerHTML = ""
  
  var site_profiles = $("#site_profiles").val();
 
  localStorage["site_profiles"] = $("#site_profiles").val();

  var innerHTML = "Options Saved."
  
  try{
  site_profiles = JSON.parse(site_profiles)
  }catch(e){
    innerHTML="Error: "+e;
  }
  
  status.innerHTML = innerHTML;
}

// Restores select box state to saved value from localStorage.
function restore_options() {
  var site_profiles = localStorage["site_profiles"];
  if (!site_profiles) {
    site_profiles=""
  }

  $("#site_profiles").val(site_profiles)
}

</script>

<body onload="restore_options()">

Site Profiles:<br>
<textarea id="site_profiles" cols="80" rows="25"></textarea>

<br>
<button onclick="save_options()">Save</button><span id="status"></span>
</body>
</html>